#!/usr/bin/env python
# encoding: utf-8
"""
@author: youfeng
@email: youfeng243@163.com
@license: Apache Licence 
@file: parse_anhui.py
@time: 2016/12/22 15:07
"""
from parse.base_object import ParseObject


class prase_object_guangdong(ParseObject):
    def __init__(self, **kwargs):
        ParseObject.__init__(self, **kwargs)

    '''
    http://gsxt.gzaic.gov.cn/aiccips/GSpublicity/GSpublicityList.html?service=entInfo_wEEbrZ8NfMTsIFxHf+eCD9GZ/Ig5Y6SDpBUToQmiXyU=-FBrJ/suNwXMupXtmIUvNKg==
    '''

    def get_base_info(self, url, item=None):

        try:
            tail = url.split('?')[1]
            param = tail.split('service=')[1]
            base_info = {'service': param}
        except Exception as e:
            self.log.exception(e)
            self.log.error('url = {url}'.format(url=url))
            return None

        return base_info
